<html>
    
<head>
 <title>EasyRTC Client JsDocs</title>
 <link rel="stylesheet" type="text/css" href="jsdoc/styles/jsdoc-client.css" />

</head>

<body>
<div id="main">
    
    <h1 class="page-title">Client API - Class easyrtc</h1>
    
    



<section>
    
<article>    
    
    
    
    
    
    
    
    
    
    
    
        <hr/><hr/>

        <h2 class="subsection-title">Members</h2>
        
        <dl>
            
<dt>
    <h3 class="name" id="ackMessage"><span class="type-signature"></span>ackMessage<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Most basic message acknowledgment object
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="BECOMING_CONNECTED"><span class="type-signature"></span>BECOMING_CONNECTED<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Value returned by easyrtc.getConnectStatus if the other user is in the process of getting connected
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="closeLocalStream"><span class="type-signature"></span>closeLocalStream<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Alias for closeLocalMediaStream
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="cookieId"><span class="type-signature"></span>cookieId<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Default cookieId name
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="errCodes"><span class="type-signature"></span>errCodes<span class="type-signature"> :Object</span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Error codes that the EasyRTC will use in the errorCode field of error object passed
to error handler set by easyrtc.setOnError. The error codes are short printable strings.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="IS_CONNECTED"><span class="type-signature"></span>IS_CONNECTED<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Value returned by easyrtc.getConnectStatus if the other user is connected to us.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="loggingOut"><span class="type-signature"></span>loggingOut<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Flag to indicate that user is currently logging out
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="maxP2PMessageLength"><span class="type-signature"></span>maxP2PMessageLength<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        This constant determines how long (in bytes) a message can be before being split in chunks of that size.
This is because there is a limitation of the length of the message you can send on the
data channel between browsers.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="myEasyrtcid"><span class="type-signature"></span>myEasyrtcid<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Your easyrtcid
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="nativeVideoHeight"><span class="type-signature"></span>nativeVideoHeight<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        The height of the local media stream video in pixels. This field is set an indeterminate period
of time after easyrtc.initMediaSource succeeds. Note: in actuality, the dimensions of a video stream
change dynamically in response to external factors, you should check the videoWidth and videoHeight attributes
of your video objects before you use them for pixel specific operations.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="nativeVideoWidth"><span class="type-signature"></span>nativeVideoWidth<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        The width of the local media stream video in pixels. This field is set an indeterminate period
of time after easyrtc.initMediaSource succeeds.  Note: in actuality, the dimensions of a video stream
change dynamically in response to external factors, you should check the videoWidth and videoHeight attributes
of your video objects before you use them for pixel specific operations.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="NOT_CONNECTED"><span class="type-signature"></span>NOT_CONNECTED<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Value returned by easyrtc.getConnectStatus if the other user isn't connected to us.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="roomJoin"><span class="type-signature"></span>roomJoin<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        The rooms the user is in. This only applies to room oriented applications and is set at the same
time a token is received.
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        
            
<dt>
    <h3 class="name" id="usernameRegExp"><span class="type-signature"></span>usernameRegExp<span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    <div class="description">
        Regular expression pattern for user ids. This will need modification to support non US character sets
    </div>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
</dd>

        </dl>
    
    
    
        <hr/><hr />
        <h2 class="subsection-title">Methods</h2>
        
        <dl>
            
<dt>
    <h3 class="name" id="addEventListener"><span class="type-signature"></span>addEventListener<span class="signature">(eventName, eventListener)</span><span class="type-signature"> &rarr; {void}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Adds an event listener for a particular type of event.
Currently the only eventName supported is "roomOccupant".
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>eventName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of the event</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>eventListener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the function that expects the event.
The eventListener gets called with the eventName as it's first argument, and the event
data as it's second argument.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">void</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="addStreamToCall"><span class="type-signature"></span>addStreamToCall<span class="signature">(easyrtcId, streamName, receiptHandler)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Add a named local stream to a call.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcId</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The id of client receiving the stream.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>streamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The name of the stream.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>receiptHandler</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is a function that gets called when the other side sends a message
  that the stream has been received. The receiptHandler gets called with an easyrtcid and a stream name. This
  argument is optional.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="buildLocalMediaStream"><span class="type-signature"></span>buildLocalMediaStream<span class="signature">(streamName, audioTracks, videoTracks)</span><span class="type-signature"> &rarr; {MediaStream}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function builds a new named local media stream from a set of existing audio and video tracks from other media streams.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>streamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is the name of the new media stream.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>audioTracks</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is an array of MediaStreamTracks</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>videoTracks</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is an array of MediaStreamTracks</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    the track created.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">MediaStream</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.buildLocalMediaStream("myComposedStream",
            easyrtc.getLocalStream("camera1").getVideoTracks(),
            easyrtc.getLocalStream("camera2").getAudioTracks());</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="call"><span class="type-signature"></span>call<span class="signature">(otherUser, callSuccessCB, callFailureCB, wasAcceptedCB, streamNames)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Initiates a call to another user. If it succeeds, the streamAcceptor callback will be called.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>otherUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the easyrtcid of the peer being called.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callSuccessCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(otherCaller, mediaType) - is called when the datachannel is established or the MediaStream is established. mediaType will have a value of "audiovideo" or "datachannel"</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callFailureCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(errorCode, errMessage) - is called if there was a system error interfering with the call.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>wasAcceptedCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(wasAccepted:boolean,otherUser:string) - is called when a call is accepted or rejected by another party. It can be left null.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>streamNames</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>
            
            
            
            
            
            <td class="description last">optional array of streamNames.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.call( otherEasyrtcid,
       function(easyrtcid, mediaType){
          console.log("Got mediaType " + mediaType + " from " + easyrtc.idToName(easyrtcid));
       },
       function(errorCode, errMessage){
          console.log("call to  " + easyrtc.idToName(otherEasyrtcid) + " failed:" + errMessage);
       },
       function(wasAccepted, easyrtcid){
           if( wasAccepted ){
              console.log("call accepted by " + easyrtc.idToName(easyrtcid));
           }
           else{
               console.log("call rejected" + easyrtc.idToName(easyrtcid));
           }
       });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="cleanId"><span class="type-signature"></span>cleanId<span class="signature">(idString)</span><span class="type-signature"> &rarr; {String}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        A convenience function to ensure that a string doesn't have symbols that will be interpreted by HTML.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>idString</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    The cleaned string.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">String</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>console.log( easyrtc.cleanId('&hello'));</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="clearMediaStream"><span class="type-signature"></span>clearMediaStream<span class="signature">(element)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Clears the media stream on a video object.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>element</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the video object.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.clearMediaStream( document.getElementById('selfVideo'));</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="closeLocalMediaStream"><span class="type-signature"></span>closeLocalMediaStream<span class="signature">(streamName)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Close the local media stream. You usually need to close the existing media stream
of a camera before reacquiring it at a different resolution.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>streamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an option stream name.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="connect"><span class="type-signature"></span>connect<span class="signature">(applicationName, successCallback, errorCallback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Connects to the EasyRTC signaling server. You must connect before trying to
call other users.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>applicationName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is a string that identifies the application so that different applications can have different
       lists of users. Note that the server configuration specifies a regular expression that is used to check application names
       for validity. The default pattern is that of an identifier, spaces are not allowed.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(easyrtcId, roomOwner) - is called on successful connect. easyrtcId is the
  unique name that the client is known to the server by. A client usually only needs it's own easyrtcId for debugging purposes.
      roomOwner is true if the user is the owner of a room. It's value is random if the user is in multiple rooms.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>errorCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(errorCode, errorText) - is called on unsuccessful connect. if null, an alert is called instead.
 The errorCode takes it's value from easyrtc.errCodes.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.connect("my_chat_app",
                  function(easyrtcid, roomOwner){
                      if( roomOwner){ console.log("I'm the room owner"); }
                      console.log("my id is " + easyrtcid);
                  },
                  function(errorText){
                      console.log("failed to connect ", erFrText);
                  });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="disconnect"><span class="type-signature"></span>disconnect<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Disconnect from the EasyRTC server.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.disconnect();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="doesDataChannelWork"><span class="type-signature"></span>doesDataChannelWork<span class="signature">(otherUser)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Checks to see if data channels work between two peers.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>otherUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the other peer.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if data channels work and are ready to be used
  between the two peers.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="emitEvent"><span class="type-signature"></span>emitEvent<span class="signature">(eventName, eventData)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Emits an event, or in other words, calls all the eventListeners for a
particular event.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>eventName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>eventData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="enableAudio"><span class="type-signature"></span>enableAudio<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets whether audio is transmitted by the local user in any subsequent calls.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enabled</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to include audio, false to exclude audio. The default is true.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.enableAudio(false);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="enableAudioReceive"><span class="type-signature"></span>enableAudioReceive<span class="signature">(value)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Control whether the client requests audio from a peer during a call.
Must be called before the call to have an effect.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>value</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">true to receive audio, false otherwise. The default is true.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="enableCamera"><span class="type-signature"></span>enableCamera<span class="signature">(enable, streamName)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function is used to enable and disable the local camera. If you disable the
camera, video objects display it will "freeze" until the camera is re-enabled. *
By default, a camera is enabled.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enable</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to enable the camera, false to disable it.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>streamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the name of the stream, optional.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="enableDataChannels"><span class="type-signature"></span>enableDataChannels<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets whether WebRTC data channels are used to send inter-client messages.
This is only the messages that applications explicitly send to other applications, not the WebRTC signaling messages.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enabled</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to use data channels, false otherwise. The default is false.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.enableDataChannels(true);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="enableDebug"><span class="type-signature"></span>enableDebug<span class="signature">(enable)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Enable or disable logging to the console.
Note: if you want to control the printing of debug messages, override the
   easyrtc.debugPrinter variable with a function that takes a message string as it's argument.
   This is exactly what easyrtc.enableDebug does when it's enable argument is true.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enable</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to turn on debugging, false to turn off debugging. Default is false.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.enableDebug(true);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="enableMicrophone"><span class="type-signature"></span>enableMicrophone<span class="signature">(enable, streamName)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function is used to enable and disable the local microphone. If you disable
the microphone, sounds stops being transmitted to your peers. By default, the microphone
is enabled.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enable</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to enable the microphone, false to disable it.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>streamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an optional streamName</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="enableVideo"><span class="type-signature"></span>enableVideo<span class="signature">(enabled)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets whether video is transmitted by the local user in any subsequent calls.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>enabled</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to include video, false to exclude video. The default is true.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.enableVideo(false);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="enableVideoReceive"><span class="type-signature"></span>enableVideoReceive<span class="signature">(value)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Control whether the client requests video from a peer during a call.
Must be called before the call to have an effect.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>value</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">true to receive video, false otherwise. The default is true.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="format"><span class="type-signature"></span>format<span class="signature">(format, arg1, arg2, arg3)</span><span class="type-signature"> &rarr; {String}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function performs a printf like formatting. It actually takes an unlimited
number of arguments, the declared arguments arg1, arg2, arg3 are present just for
documentation purposes.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>format</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A string like "abcd{1}efg{2}hij{1}."</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>arg1</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The value that replaces {1}</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>arg2</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The value that replaces {2}</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>arg3</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">The value that replaces {3}</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    the formatted string.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">String</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getApplicationFields"><span class="type-signature"></span>getApplicationFields<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get server defined fields associated with the current application. Only valid
after a connection has been made.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A dictionary containing entries of the form {key:{'fieldName':key, 'fieldValue':value1}}
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getAudioSinkList"><span class="type-signature"></span>getAudioSinkList<span class="signature">(callback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets a list of the available audio sinks (ie, speakers)
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">receives list of {deviceId:String, groupId:String, label:String, kind:"audio"}</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.getAudioSinkList( function(list) {
              var i;
              for( i = 0; i < list.length; i++ ) {
                  console.log("label=" + list[i].label + ", id= " + list[i].deviceId);
              }
         });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getAudioSourceList"><span class="type-signature"></span>getAudioSourceList<span class="signature">(callback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets a list of the available audio sources (ie, microphones)
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">receives list of {deviceId:String, groupId:String, label:String, kind:"audio"}</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.getAudioSourceList( function(list) {
              var i;
              for( i = 0; i < list.length; i++ ) {
                  console.log("label=" + list[i].label + ", id= " + list[i].deviceId);
              }
         });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getConnectionCount"><span class="type-signature"></span>getConnectionCount<span class="signature">()</span><span class="type-signature"> &rarr; {Number}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns the number of live peer connections the client has.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Number</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>("You have " + easyrtc.getConnectionCount() + " peer connections");</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getConnectionFields"><span class="type-signature"></span>getConnectionFields<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get server defined fields associated with the connection. Only valid
after a connection has been made.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A dictionary containing entries of the form {key:{'fieldName':key, 'fieldValue':value1}}
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getConnectStatus"><span class="type-signature"></span>getConnectStatus<span class="signature">(otherUser)</span><span class="type-signature"> &rarr; {String}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Check if the client has a peer-2-peer connection to another user.
The return values are text strings so you can use them in debugging output.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>otherUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the easyrtcid of the other user.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    one of the following values: easyrtc.NOT_CONNECTED, easyrtc.BECOMING_CONNECTED, easyrtc.IS_CONNECTED
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">String</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>if( easyrtc.getConnectStatus(otherEasyrtcid) == easyrtc.NOT_CONNECTED ){
        easyrtc.call(otherEasyrtcid,
                 function(){ console.log("success"); },
                 function(){ console.log("failure"); });
    }</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getFreshIceConfig"><span class="type-signature"></span>getFreshIceConfig<span class="signature">(callback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Request fresh ice config information from the server.
This should be done periodically by long running applications.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is called with a value of true on success, false on failure.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getLocalMediaIds"><span class="type-signature"></span>getLocalMediaIds<span class="signature">()</span><span class="type-signature"> &rarr; {Array}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns the user assigned id's of currently active local media streams.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Array</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getLocalStream"><span class="type-signature"></span>getLocalStream<span class="signature">()</span><span class="type-signature"> &rarr; {MediaStream}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns a media stream for your local camera and microphone.
 It can be called only after easyrtc.initMediaSource has succeeded.
 It returns a stream that can be used as an argument to easyrtc.setVideoObjectSrc.
 Returns null if there is no local media stream acquired yet.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">MediaStream</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setVideoObjectSrc( document.getElementById("myVideo"), easyrtc.getLocalStream());</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getPeerConnectionByUserId"><span class="type-signature"></span>getPeerConnectionByUserId<span class="signature">(easyrtcid, for)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function gets the raw RTCPeerConnection for a given easyrtcid
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>for</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">RTCPeerConnection</span>


            
            </td>
            
            
            
            
            
            <td class="description last">that easyrtcid, or null if no connection exists
Submitted by Fabian Bernhard.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getPeerStatistics"><span class="type-signature"></span>getPeerStatistics<span class="signature">(easyrtcid, callback, filter)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function gets the statistics for a particular peer connection.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">gets the easyrtcid for the peer and a map of {userDefinedKey: value}. If there is no peer connection to easyrtcid, then the map will
 have a value of {connected:false}.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>filter</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">depends on whether Chrome or Firefox is used. See the default filters for guidance.
It is still experimental.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getRemoteStream"><span class="type-signature"></span>getRemoteStream<span class="signature">(easyrtcid, remoteStreamName)</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Return the media stream shared by a particular peer. This is needed when you
add a stream in the middle of a call.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the peer.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>remoteStreamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an optional argument supplying the streamName.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A mediaStream.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomApiField"><span class="type-signature"></span>getRoomApiField<span class="signature">(roomName, easyrtcid, fieldName)</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns another peers API field, if it exists.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fieldName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">type</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Undefined if the attribute does not exist, its value otherwise.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomField"><span class="type-signature"></span>getRoomField<span class="signature">(roomName, fieldName)</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets a data field associated with a room.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the name of the room.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fieldName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the name of the field.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    dataValue - the value of the field if present, undefined if not present.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomFields"><span class="type-signature"></span>getRoomFields<span class="signature">(roomName)</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get server defined fields associated with a particular room. Only valid
after a connection has been made.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the name of the room you want the fields for.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A dictionary containing entries of the form {key:{'fieldName':key, 'fieldValue':value1}} or undefined
if you are not connected to the room.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomList"><span class="type-signature"></span>getRoomList<span class="signature">(callback, errorCallback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends the server a request for the list of rooms the user can see.
You must have already be connected to use this function.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">on success, this function is called with a map of the form  { roomName:{"roomName":String, "numberClients": Number}}.
The roomName appears as both the key to the map, and as the value of the "roomName" field.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>errorCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is called on failure. It gets an errorCode and errorText as it's too arguments.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.getRoomList(
       function(roomList){
          for(roomName in roomList){
             console.log("saw room " + roomName);
          }
        },
        function(errorCode, errorText){
           easyrtc.showError(errorCode, errorText);
        }
   );</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomOccupantsAsArray"><span class="type-signature"></span>getRoomOccupantsAsArray<span class="signature">(roomName)</span><span class="type-signature"> &rarr; {Array}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns an array of easyrtcid's of peers in a particular room.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    of easyrtcids or null if the client is not in the room.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Array</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>var occupants = easyrtc.getRoomOccupants("default");
    var i;
    for( i = 0; i < occupants.length; i++ ) {
        console.log( occupants[i] + " is in the room");
    }</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomOccupantsAsMap"><span class="type-signature"></span>getRoomOccupantsAsMap<span class="signature">(roomName)</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns a map of easyrtcid's of peers in a particular room. You should only test elements in the map to see if they are
null; their actual values are not guaranteed to be the same in different releases.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    of easyrtcids or null if the client is not in the room.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>if( easyrtc.getRoomOccupantsAsMap("default")[some_easyrtcid]) {
         console.log("yep, " + some_easyrtcid + " is in the room");
     }</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="getRoomsJoined"><span class="type-signature"></span>getRoomsJoined<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get a list of the rooms you are in. You must be connected to call this function.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    A map whose keys are the room names
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getServerIce"><span class="type-signature"></span>getServerIce<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns the last ice config supplied by the EasyRTC server. This function is not normally used, it is provided
for people who want to try filtering ice server configuration on the client.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    which has the form {iceServers:[ice_server_entry, ice_server_entry, ...]}
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getSessionField"><span class="type-signature"></span>getSessionField<span class="signature">(name)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Fetch the value of a session field by name.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">name of the session field to be fetched.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    the field value (which can be anything). Returns undefined if the field does not exist.
</div>



        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getSessionFields"><span class="type-signature"></span>getSessionFields<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Fetch the collection of session fields as a map. The map has the structure:
 {key1: {"fieldName": key1, "fieldValue": value1}, ...,
  key2: {"fieldName": key2, "fieldValue": value2}
 }
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="getVideoSourceList"><span class="type-signature"></span>getVideoSourceList<span class="signature">(callback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Gets a list of the available video sources (ie, cameras)
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">receives list of {deviceId:String, groupId:String, label:String, kind:"video"}</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.getVideoSourceList( function(list) {
              var i;
              for( i = 0; i < list.length; i++ ) {
                  console.log("label=" + list[i].label + ", id= " + list[i].deviceId);
              }
         });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="hangup"><span class="type-signature"></span>hangup<span class="signature">(otherUser)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Hang up on a particular user or all users.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>otherUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the easyrtcid of the person to hang up on.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.hangup(someEasyrtcid);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="hangupAll"><span class="type-signature"></span>hangupAll<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Hangs up on all current connections.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.hangupAll();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="haveAudioTrack"><span class="type-signature"></span>haveAudioTrack<span class="signature">(easyrtcid, streamName)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines if a particular peer2peer connection has an audio track.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the id of the other caller in the connection. If easyrtcid is not supplied, checks the local media.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>streamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an optional stream id.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if there is an audio track or the browser can't tell us.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="haveVideoTrack"><span class="type-signature"></span>haveVideoTrack<span class="signature">(easyrtcid, streamName)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines if a particular peer2peer connection has a video track.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the id of the other caller in the connection. If easyrtcid is not supplied, checks the local media.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>streamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an optional stream id.     *</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if there is an video track or the browser can't tell us.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="idToName"><span class="type-signature"></span>idToName<span class="signature">(easyrtcid)</span><span class="type-signature"> &rarr; {String}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Convert an easyrtcid to a user name. This is useful for labeling buttons and messages
regarding peers.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    the username associated with the easyrtcid, or the easyrtcid if there is
no associated username.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">String</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>console.log(easyrtcid + " is actually " + easyrtc.idToName(easyrtcid));</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="initMediaSource"><span class="type-signature"></span>initMediaSource<span class="signature">(successCallback, errorCallback, streamName)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Initializes your access to a local camera and microphone.
Failure could be caused a browser that didn't support WebRTC, or by the user not granting permission.
If you are going to call easyrtc.enableAudio or easyrtc.enableVideo, you need to do it before
calling easyrtc.initMediaSource.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>successCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">will be called with localmedia stream on success.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>errorCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is called with an error code and error description.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>streamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an optional name for the media source so you can use multiple cameras and
screen share simultaneously.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.initMediaSource(
         function(mediastream){
             easyrtc.setVideoObjectSrc( document.getElementById("mirrorVideo"), mediastream);
         },
         function(errorCode, errorText){
              easyrtc.showError(errorCode, errorText);
         });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="isNameValid"><span class="type-signature"></span>isNameValid<span class="signature">(name)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Checks if the supplied string is a valid user name (standard identifier rules)
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true for a valid user name
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>var name = document.getElementById('nameField').value;
   if( !easyrtc.isNameValid(name)){
       console.error("Bad user name");
   }</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="isPeerInAnyRoom"><span class="type-signature"></span>isPeerInAnyRoom<span class="signature">(easyrtcid)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Checks to see if a particular peer is present in any room.
If it isn't, we assume it's logged out.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last">the easyrtcId of the peer.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="isStunServer"><span class="type-signature"></span>isStunServer<span class="signature">(ipAddress)</span><span class="type-signature"> &rarr; {boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns true if the ipAddress parameter was the address of a stun server. This is done by checking against information
collected during peer to peer calls. Don't expect it to work before the first call, or to identify turn servers that aren't
in the ice config.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>ipAddress</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if ip address is known to be that of a stun server, false otherwise.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="isTurnServer"><span class="type-signature"></span>isTurnServer<span class="signature">(ipAddress)</span><span class="type-signature"> &rarr; {boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Returns true if the ipAddress parameter was the address of a turn server. This is done by checking against information
collected during peer to peer calls. Don't expect it to work before the first call, or to identify turn servers that aren't
in the ice config.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>ipAddress</code></td>
            
            
            <td class="type">
            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if ip address is known to be that of a turn server, false otherwise.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="joinRoom"><span class="type-signature"></span>joinRoom<span class="signature">(roomName, roomParameters, successCB, failureCB)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This method allows you to join a single room. It may be called multiple times to be in
multiple rooms simultaneously. It may be called before or after connecting to the server.
Note: the successCB and failureDB will only be called if you are already connected to the server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the room to be joined.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>roomParameters</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">application specific parameters, can be null.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">called once, with a roomName as it's argument, once the room is joined.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>failureCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">called if the room can not be joined. The arguments of failureCB are errorCode, errorText, roomName.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="leaveRoom"><span class="type-signature"></span>leaveRoom<span class="signature">(roomName, successCallback, failureCallback)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function allows you to leave a single room. Note: the successCB and failureDB
 arguments are optional and will only be called if you are already connected to the server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A function which expects a roomName.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>failureCallback</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A function which expects the following arguments: errorCode, errorText, roomName.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.leaveRoom("freds_room");
   easyrtc.leaveRoom("freds_room", function(roomName){ console.log("left the room")},
                      function(errorCode, errorText, roomName){ console.log("left the room")});</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="loadStylesheet"><span class="type-signature"></span>loadStylesheet<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Load Easyrtc Stylesheet.
  Easyrtc Stylesheet define easyrtcMirror class and some basic css class for using easyrtc.js.
  That way, developers can override it or use it's own css file minified css or package.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.loadStylesheet();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="makeLocalStreamFromRemoteStream"><span class="type-signature"></span>makeLocalStreamFromRemoteStream<span class="signature">(easyrtcid, remoteStreamName, localStreamName)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Assign a local streamName to a remote stream so that it can be forwarded to other callers.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>easyrtcid</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the peer supplying the remote stream</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>remoteStreamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the streamName supplied by the peer.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>localStreamName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">streamName used when passing the stream to other peers.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.makeLocalStreamFromRemoteStream(sourcePeer, "default", "forwardedStream");
   easyrtc.call(nextPeer, callSuccessCB, callFailureCB, wasAcceptedCB, ["forwardedStream"]);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="muteVideoObject"><span class="type-signature"></span>muteVideoObject<span class="signature">(videoObjectName, mute)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Mute a video object.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>videoObjectName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A DOMObject or the id of the DOMObject.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>mute</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to mute the video object, false to unmute it.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="register3rdPartyLocalMediaStream"><span class="type-signature"></span>register3rdPartyLocalMediaStream<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Allow an externally created mediastream (ie, created by another
library) to be used within easyrtc. Tracking when it closes
must be done by the supplying party.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="removeEventListener"><span class="type-signature"></span>removeEventListener<span class="signature">(eventName, eventListener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Removes an event listener.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>eventName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>eventListener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="sendData"><span class="type-signature"></span>sendData<span class="signature">(destUser, msgType, msgData, ackHandler)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends data to another user. This method uses data channels if one has been set up, or websockets otherwise.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>destUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a string containing the easyrtcId of the other user.
Specifying multiple fields restricts the scope of the destination (operates as a logical AND, not a logical OR).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONable object.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>ackHandler</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a function which receives acknowledgments. May only be invoked in
 the websocket case.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.sendData(someEasyrtcid, "roomData",  {room:499, bldgNum:'asd'},
      function ackHandler(msgType, msgData);
   );</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="sendDataP2P"><span class="type-signature"></span>sendDataP2P<span class="signature">(destUser, msgType, msgData)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends data to another user using previously established data channel. This method will
fail if no data channel has been established yet. Unlike the easyrtc.sendWS method,
you can't send a dictionary, convert dictionaries to strings using JSON.stringify first.
What data types you can send, and how large a data type depends on your browser.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>destUser</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">(an easyrtcid)</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONable object.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.sendDataP2P(someEasyrtcid, "roomData", {room:499, bldgNum:'asd'});</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="sendDataWS"><span class="type-signature"></span>sendDataWS<span class="signature">(destination, msgType, msgData, ackhandler)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends data to another user using websockets. The easyrtc.sendServerMessage or easyrtc.sendPeerMessage methods
are wrappers for this method; application code should use them instead.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>destination</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">either a string containing the easyrtcId of the other user, or an object containing some subset of the following fields: targetEasyrtcid, targetGroup, targetRoom.
Specifying multiple fields restricts the scope of the destination (operates as a logical AND, not a logical OR).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONable object.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>ackhandler</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">by default, the ackhandler handles acknowledgments from the server that your message was delivered to it's destination.
However, application logic in the server can over-ride this. If you leave this null, a stub ackHandler will be used. The ackHandler
gets passed a message with the same msgType as your outgoing message, or a message type of "error" in which case
msgData will contain a errorCode and errorText fields.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.sendDataWS(someEasyrtcid, "setPostalAddress", {room:499, bldgNum:'asd'},
     function(ackMsg){
         console.log("saw the following acknowledgment " + JSON.stringify(ackMsg));
     }
   );</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="sendPeerMessage"><span class="type-signature"></span>sendPeerMessage<span class="signature">(destination, msgType, msgData, successCB, failureCB)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends a message to another peer on the easyrtcMsg channel.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>destination</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">either a string containing the easyrtcId of the other user, or an object containing some subset of the following fields: targetEasyrtcid, targetGroup, targetRoom.
Specifying multiple fields restricts the scope of the destination (operates as a logical AND, not a logical OR).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONable object with the message contents.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function with results from the server.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>failureCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function to handle errors.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.sendPeerMessage(otherUser, 'offer_candy', {candy_name:'mars'},
            function(msgType, msgBody ){
               console.log("message was sent");
            },
            function(errorCode, errorText){
               console.log("error was " + errorText);
            });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="sendServerMessage"><span class="type-signature"></span>sendServerMessage<span class="signature">(msgType, msgData, successCB, failureCB)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sends a message to the application code in the server (ie, on the easyrtcMsg channel).
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the type of message being sent (application specific).</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgData</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONable object with the message contents.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>successCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function with results from the server.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>failureCB</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a callback function to handle errors.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.sendServerMessage('get_candy', {candy_name:'mars'},
            function(msgType, msgData ){
               console.log("got candy count of " + msgData.barCount);
            },
            function(errorCode, errorText){
               console.log("error was " + errorText);
            });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setAcceptChecker"><span class="type-signature"></span>setAcceptChecker<span class="signature">(acceptCheck)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the callback used to decide whether to accept or reject an incoming call.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>acceptCheck</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes the arguments (callerEasyrtcid, acceptor).
The acceptCheck callback is passed an easyrtcid and an acceptor function. The acceptor function should be called with either
a true value (accept the call) or false value( reject the call) as it's first argument, and optionally,
an array of local media streamNames as a second argument.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setAcceptChecker( function(easyrtcid, acceptor){
          if( easyrtc.idToName(easyrtcid) === 'Fred' ){
             acceptor(true);
          }
          else if( easyrtc.idToName(easyrtcid) === 'Barney' ){
             setTimeout( function(){
     acceptor(true, ['myOtherCam']); // myOtherCam presumed to a streamName
     }, 10000);
          }
          else{
             acceptor(false);
          }
     });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setApplicationName"><span class="type-signature"></span>setApplicationName<span class="signature">(name)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Set the application name. Applications can only communicate with other applications
that share the same API Key and application name. There is no predefined set of application
names. Maximum length is
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setApplicationName('simpleAudioVideo');</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setAudioOutput"><span class="type-signature"></span>setAudioOutput<span class="signature">(element, sinkId)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the audio output device of a Video object. 
That is to say, this controls what speakers get the sound.
In theory, this works on Chrome but probably doesn't work anywhere else yet.
This code was cribbed from https://webrtc.github.io/samples/src/content/devices/multi/.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>element</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an HTML5 video element</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>sinkId</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a deviceid from getAudioSinkList</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setAudioSource"><span class="type-signature"></span>setAudioSource<span class="signature">(audioSrcId)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Specify particular video source. Call this before you call easyrtc.initMediaSource().
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>audioSrcId</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is a id value from one of the entries fetched by getAudioSourceList. null for default.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setAudioSource( audioSrcId);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setAutoInitUserMedia"><span class="type-signature"></span>setAutoInitUserMedia<span class="signature">(flag)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Controls whether a default local media stream should be acquired automatically during calls and accepts
if a list of streamNames is not supplied. The default is true, which mimics the behaviour of earlier releases
that didn't support multiple streams. This function should be called before easyrtc.call or before entering an
accept  callback.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>flag</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">true to allocate a default local media stream.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setCallCancelled"><span class="type-signature"></span>setCallCancelled<span class="signature">(callCancelled)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the callCancelled callback. This will be called when a remote user
initiates a call to you, but does a "hangup" before you have a chance to get his video stream.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>callCancelled</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes an easyrtcid as an argument and a boolean that indicates whether
 the call was explicitly cancelled remotely (true), or actually accepted by the user attempting a call to
 the same party.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setCallCancelled( function(easyrtcid, explicitlyCancelled){
       if( explicitlyCancelled ){
           console.log(easyrtc.idToName(easyrtcid) + " stopped trying to reach you");
        }
        else{
           console.log("Implicitly called "  + easyrtc.idToName(easyrtcid));
        }
    });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setCookieId"><span class="type-signature"></span>setCookieId<span class="signature">(cookieId)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function sets the name of the cookie that client side library will look for
and transmit back to the server as it's easyrtcsid in the first message.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>cookieId</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setCredential"><span class="type-signature"></span>setCredential<span class="signature">(credentialParm)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Set the authentication credential if needed.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>credentialParm</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a JSONable object.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setDataChannelCloseListener"><span class="type-signature"></span>setDataChannelCloseListener<span class="signature">(listener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a callback that is called when a previously open data channel closes.
The callback will be called with an easyrtcid as it's sole argument.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setDataChannelCloseListener( function(easyrtcid){
           ("No longer connected to " + easyrtc.idToName(easyrtcid));
   });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setDataChannelOpenListener"><span class="type-signature"></span>setDataChannelOpenListener<span class="signature">(listener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a callback that is called when a data channel is open and ready to send data.
The callback will be called with an easyrtcid as it's sole argument.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setDataChannelOpenListener( function(easyrtcid){
        easyrtc.sendDataP2P(easyrtcid, "greeting", "hello");
   });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setDisconnectListener"><span class="type-signature"></span>setDisconnectListener<span class="signature">(disconnectListener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the listener for socket disconnection by external (to the API) reasons.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>disconnectListener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes no arguments and is not called as a result of calling easyrtc.disconnect.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setDisconnectListener(function(){
       easyrtc.showError("SYSTEM-ERROR", "Lost our connection to the socket server");
   });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setIceCandidateFilter"><span class="type-signature"></span>setIceCandidateFilter<span class="signature">(filter)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a function which filters IceCandidate records being sent or received.

Candidate records can be received while they are being generated locally (before being
sent to a peer), and after they are received by the peer. The filter receives two arguments, the candidate record and a boolean
flag that is true for a candidate being received from another peer,
and false for a candidate that was generated locally. The candidate record has the form:
 {type: 'candidate', label: sdpMLineIndex, id: sdpMid, candidate: candidateString}
The function should return one of the following: the input candidate record, a modified candidate record, or null (indicating that the
candidate should be discarded).
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>filter</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setIceConnectionStateChangeListener"><span class="type-signature"></span>setIceConnectionStateChangeListener<span class="signature">(listener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a function that listens on IceConnectionStateChange events.

During ICE negotiation the peer connection fires the iceconnectionstatechange event.
It is sometimes useful for the application to learn about these changes, especially if the ICE connection fails.
The function should accept two parameters: the easyrtc id of the peer and the iceconnectionstatechange event target.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setIceUsedInCalls"><span class="type-signature"></span>setIceUsedInCalls<span class="signature">(ice)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the ice server configuration that will be used in subsequent calls. You only need this function if you are filtering
the ice server configuration on the client or if you are using TURN certificates that have a very short lifespan.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>ice</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">An object with iceServers element containing an array of ice server entries.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setIceUsedInCalls( {"iceServers": [
     {
        "url": "stun:stun.sipgate.net"
     },
     {
        "url": "stun:217.10.68.152"
     },
     {
        "url": "stun:stun.sipgate.net:10000"
     }
     ]});
     easyrtc.call(...);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setMaxP2PMessageLength"><span class="type-signature"></span>setMaxP2PMessageLength<span class="signature">(maxLength)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the maximum length in bytes of P2P messages that can be sent.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>maxLength</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>
            
            
            
            
            
            <td class="description last">maximum length to set</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setMaxP2PMessageLength(10000);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setOnStreamClosed"><span class="type-signature"></span>setOnStreamClosed<span class="signature">(onStreamClosed)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a callback to receive notification of a media stream closing. The usual
 use of this is to clear the source of your video object so you aren't left with
 the last frame of the video displayed on it.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>onStreamClosed</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes an easyrtcid as it's first parameter, the stream as it's second argument, and name of the video stream as it's third.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setOnStreamClosed( function(easyrtcid, stream, streamName){
        easyrtc.setVideoObjectSrc( document.getElementById("callerVideo"), "");
        ( easyrtc.idToName(easyrtcid) + " closed stream " + stream.id + " " + streamName);
    });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setPeerClosedListener"><span class="type-signature"></span>setPeerClosedListener<span class="signature">(handler:)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a function to warn about the peer connection closing.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>handler:</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a function that gets an easyrtcid as an argument.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setPeerFailingListener"><span class="type-signature"></span>setPeerFailingListener<span class="signature">(failingHandler:, recoveredHandler:)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a function to receive warnings about the peer connection
failing. The peer connection may recover by itself.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>failingHandler:</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a function that gets an easyrtcid as an argument.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>recoveredHandler:</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a function that gets an easyrtcid as an argument.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setPeerListener"><span class="type-signature"></span>setPeerListener<span class="signature">(listener, msgType, source)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a listener for data sent from another client (either peer to peer or via websockets).
If no msgType or source is provided, the listener applies to all events that aren't otherwise handled.
If a msgType but no source is provided, the listener applies to all messages of that msgType that aren't otherwise handled.
If a msgType and a source is provided, the listener applies to only message of the specified type coming from the specified peer.
The most specific case takes priority over the more general.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">has the signature (easyrtcid, msgType, msgData, targeting).
  msgType is a string. targeting is null if the message was received using WebRTC data channels, otherwise it
  is an object that contains one or more of the following string valued elements {targetEasyrtcid, targetGroup, targetRoom}.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>msgType</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a string, optional.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>source</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the sender's easyrtcid, optional.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setPeerListener( function(easyrtcid, msgType, msgData, targeting){
        console.log("From " + easyrtc.idToName(easyrtcid) +
            " sent the following data " + JSON.stringify(msgData));
    });
    easyrtc.setPeerListener( function(easyrtcid, msgType, msgData, targeting){
        console.log("From " + easyrtc.idToName(easyrtcid) +
            " sent the following data " + JSON.stringify(msgData));
    }, 'food', 'dkdjdekj44--');
    easyrtc.setPeerListener( function(easyrtcid, msgType, msgData, targeting){
        console.log("From " + easyrtcid +
            " sent the following data " + JSON.stringify(msgData));
    }, 'drink');</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setRoomApiField"><span class="type-signature"></span>setRoomApiField<span class="signature">(roomName, fieldName, fieldValue)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Provide a set of application defined fields that will be part of this instances
configuration information. This data will get sent to other peers via the websocket
path.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>roomName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the room the field is attached to.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fieldName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the name of the field.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>fieldValue</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the value of the field.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setRoomApiField("trekkieRoom",  "favorite_alien", "Mr Spock");
  easyrtc.setRoomOccupantListener( function(roomName, list){
     for( var i in list ){
        console.log("easyrtcid=" + i + " favorite alien is " + list[i].apiFields.favorite_alien);
     }
  });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setScreenCapture"><span class="type-signature"></span>setScreenCapture<span class="signature">()</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function requests that screen capturing be used to provide the local media source
rather than a webcam. If you have multiple screens, they are composited side by side.
Note: this functionality is not supported by Firefox, has to be called before calling initMediaSource (or easyApp), we don't currently supply a way to
turn it off (once it's on), only works if the website is hosted SSL (https), and the image quality is rather
poor going across a network because it tries to transmit so much data. In short, screen sharing
through WebRTC isn't worth using at this point, but it is provided here so people can try it out.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setScreenCapture();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setSdpFilters"><span class="type-signature"></span>setSdpFilters<span class="signature">(localFilter, remoteFilter)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets functions which filter sdp records before calling setLocalDescription or setRemoteDescription.
This is advanced functionality which can break things, easily. See the easyrtc_rates.js file for a
filter builder.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>localFilter</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a function that takes an sdp string and returns an sdp string.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>remoteFilter</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a function that takes an sdp string and returns an sdp string.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setServerListener"><span class="type-signature"></span>setServerListener<span class="signature">(listener)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a listener for messages from the server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>listener</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">has the signature (msgType, msgData, targeting)</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setServerListener( function(msgType, msgData, targeting){
        ("The Server sent the following message " + JSON.stringify(msgData));
    });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setSocketUrl"><span class="type-signature"></span>setSocketUrl<span class="signature">(socketUrl, options)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the url of the Socket server.
The node.js server is great as a socket server, but it doesn't have
all the hooks you'd like in a general web server, like PHP or Python
plug-ins. By setting the serverPath your application can get it's regular
pages from a regular web server, but the EasyRTC library can still reach the
socket server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>socketUrl</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last"></td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>options</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an optional dictionary of options for socket.io's connect method.
The default is {'connect timeout': 10000,'force new connection': true }</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setSocketUrl(":8080", options);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setStreamAcceptor"><span class="type-signature"></span>setStreamAcceptor<span class="signature">(acceptor)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        easyrtc.setStreamAcceptor sets a callback to receive media streams from other peers, independent
of where the call was initiated (caller or callee).
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>acceptor</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>
            
            
            
            
            
            <td class="description last">takes arguments (caller, mediaStream, mediaStreamName)</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setStreamAcceptor(function(easyrtcid, stream, streamName){
    document.getElementById('callerName').innerHTML = easyrtc.idToName(easyrtcid);
    easyrtc.setVideoObjectSrc( document.getElementById("callerVideo"), stream);
 });</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setUseFreshIceEachPeerConnection"><span class="type-signature"></span>setUseFreshIceEachPeerConnection<span class="signature">(value)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines whether fresh ice server configuration should be requested from the server for each peer connection.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>value</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the default is false.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="setUsername"><span class="type-signature"></span>setUsername<span class="signature">(username)</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the user name associated with the connection.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>username</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">must obey standard identifier conventions.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    true if the call succeeded, false if the username was invalid.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>if( !easyrtc.setUsername("JohnSmith") ){
       console.error("bad user name);
   }</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setVideoDims"><span class="type-signature"></span>setVideoDims<span class="signature">(width, height, frameRate)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        This function is used to set the dimensions of the local camera, usually to get HD.
 If called, it must be called before calling easyrtc.initMediaSource (explicitly or implicitly).
 assuming it is supported. If you don't pass any parameters, it will use default camera dimensions.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>width</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>
            
            
            
            
            
            <td class="description last">in pixels</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>height</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>
            
            
            
            
            
            <td class="description last">in pixels</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>frameRate</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is optional</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Examples</h5>
        
    <pre class="prettyprint"><code>easyrtc.setVideoDims(1280,720);</code></pre>

    <pre class="prettyprint"><code>easyrtc.setVideoDims();</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setVideoObjectSrc"><span class="type-signature"></span>setVideoObjectSrc<span class="signature">(element, stream)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets a video or audio object from a media stream.
 Chrome uses the src attribute and expects a URL, while firefox
 uses the mozSrcObject and expects a stream. This procedure hides
 that from you.
 If the media stream is from a local webcam, you may want to add the
 easyrtcMirror class to the video object so it looks like a proper mirror.
 The easyrtcMirror class is defined in this.css.
 Which is could be added using the same path of easyrtc.js file to an HTML file
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>element</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an HTML5 video element</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>stream</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">MediaStream</span>
|

<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">a media stream as returned by easyrtc.getLocalStream or your stream acceptor.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setVideoObjectSrc( document.getElementById("myVideo"), easyrtc.getLocalStream());</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="setVideoSource"><span class="type-signature"></span>setVideoSource<span class="signature">(videoSrcId)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Specify particular video source. Call this before you call easyrtc.initMediaSource().
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>videoSrcId</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">is a id value from one of the entries fetched by getVideoSourceList. null for default.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.setVideoSource( videoSrcId);</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="showError"><span class="type-signature"></span>showError<span class="signature">(messageCode, message)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Default error reporting function. The default implementation displays error messages
in a programmatically created div with the id easyrtcErrorDialog. The div has title
component with a class name of easyrtcErrorDialog_title. The error messages get added to a
container with the id easyrtcErrorDialog_body. Each error message is a text node inside a div
with a class of easyrtcErrorDialog_element. There is an "okay" button with the className of easyrtcErrorDialog_okayButton.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>messageCode</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">An error message code</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>message</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the error message text without any markup.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.showError("BAD_NAME", "Invalid username");</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="supportsDataChannels"><span class="type-signature"></span>supportsDataChannels<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines whether the current browser supports the new data channels.
EasyRTC will not open up connections with the old data channels.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            


<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="supportsGetUserMedia"><span class="type-signature"></span>supportsGetUserMedia<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines if the local browser supports WebRTC GetUserMedia (access to camera and microphone).
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    True getUserMedia is supported.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="supportsPeerConnections"><span class="type-signature"></span>supportsPeerConnections<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Determines if the local browser supports WebRTC Peer connections to the extent of being able to do video chats.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    True if Peer connections are supported.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Boolean</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="updatePresence"><span class="type-signature"></span>updatePresence<span class="signature">(state, statusText)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Sets the presence state on the server.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>state</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">one of 'away','chat','dnd','xa'</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>statusText</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">User configurable status string. May be length limited.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>easyrtc.updatePresence('dnd', 'sleeping');</code></pre>

    
</dd>

        
            
<dt>
    <h3 class="name" id="usernameToIds"><span class="type-signature"></span>usernameToIds<span class="signature">(username, room)</span><span class="type-signature"> &rarr; {Array}</span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get an array of easyrtcids that are using a particular username
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>username</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">the username of interest.</td>
        </tr>
	
	
	
        <tr>
            
                <td class="name"><code>room</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">an optional room name argument limiting results to a particular room.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    an array of {easyrtcid:id, roomName: roomName}.
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Array</span>


	</dd>
</dl>

        
    
    
</dd>

        
            
<dt>
    <h3 class="name" id="useThisSocketConnection"><span class="type-signature"></span>useThisSocketConnection<span class="signature">(alreadyAllocatedSocketIo)</span><span class="type-signature"></span></h3>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Supply a socket.io connection that will be used instead of allocating a new socket.
The expected usage is that you allocate a websocket, assign options to it, call
easyrtc.useThisSocketConnection, followed by easyrtc.connect or easyrtc.easyApp. Easyrtc will not attempt to
close sockets that were supplied with easyrtc.useThisSocketConnection.
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>alreadyAllocatedSocketIo</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>
            
            
            
            
            
            <td class="description last">A value allocated with the connect method of socket.io.</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
</dl>

    
    
    
    
    
    
    
    
</dd>

        </dl>
    
    
    
    
    
</article>

</section>  




</div>


<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Fri Sep 16 2016 14:46:21 GMT-0700 (PDT)
</footer>

<script> prettyPrint(); </script>
</body>
</html>